
#ifndef GKT_WIDGET_DEFINES_H
#define GKT_WIDGET_DEFINES_H

#if defined(GKT_CONFIG_SCREEN_ENABLE) && GKT_CONFIG_SCREEN_ENABLE

#include "gkt_screen.h"

#ifdef GKT_CONFIG_WIDGET_X_DIST_DEFAULT
#define GKT_WIDGET_X_DIST_DEFAULT	GKT_CONFIG_WIDGET_X_DIST_DEFAULT
#else
#define GKT_WIDGET_X_DIST_DEFAULT	0
#endif

#ifdef GKT_CONFIG_WIDGET_BORDER_WIDTH
#define GKT_WIDGET_BORDER_WIDTH	GKT_CONFIG_WIDGET_BORDER_WIDTH
#else
#define GKT_WIDGET_BORDER_WIDTH	1
#endif

#ifdef GKT_CONFIG_WIDGET_FONT_MINSIZE
#define GKT_WIDGET_FONT_MINSIZE	GKT_CONFIG_WIDGET_FONT_MINSIZE
#else
#define GKT_WIDGET_FONT_MINSIZE	12
#endif

#ifdef GKT_CONFIG_WIDGET_TEXT_X_DIST
#define GKT_WIDGET_TEXT_X_DIST	GKT_CONFIG_WIDGET_TEXT_X_DIST
#else
#define GKT_WIDGET_TEXT_X_DIST	1
#endif

#ifdef GKT_CONFIG_WIDGET_TEXT_X_SPACE
#define GKT_WIDGET_TEXT_X_SPACE	GKT_CONFIG_WIDGET_TEXT_X_SPACE
#else
#define GKT_WIDGET_TEXT_X_SPACE	0
#endif

/* widget color */
#if defined(GKT_CONFIG_WIDGET_BGCOLOR_VARIOUS) \
	&& GKT_CONFIG_WIDGET_BGCOLOR_VARIOUS
#define GKT_WIDGET_BGCOLOR_VARIOUS	1
#else
#define GKT_WIDGET_BGCOLOR_VARIOUS	0
#endif

#ifdef GKT_SCREEN_FG_COLOR_DEFAULT
#define GKT_WIDGET_FG_COLOR_DEFAULT	GKT_SCREEN_FG_COLOR_DEFAULT
#else
#define GKT_WIDGET_FG_COLOR_DEFAULT	GKT_COLOR_WHITE
#endif

#ifdef GKT_SCREEN_BG_COLOR_DEFAULT
#define GKT_WIDGET_BG_COLOR_DEFAULT	GKT_SCREEN_BG_COLOR_DEFAULT
#else
#define GKT_WIDGET_BG_COLOR_DEFAULT	GKT_COLOR_BLACK
#endif

#if (GKT_SCREEN_PF_MONOCHROME == GKT_SCREEN_PF)
#define GKT_WIDGET_MULTIPLE_COLOR_ENABLE	0
#define GKT_WIDGET_FG_COLOR(widget)	GKT_WIDGET_FG_COLOR_DEFAULT
#define GKT_WIDGET_BG_COLOR(widget)	GKT_WIDGET_BG_COLOR_DEFAULT
#else
#define GKT_WIDGET_MULTIPLE_COLOR_ENABLE	1
#define GKT_WIDGET_FG_COLOR(widget)	(widget)->fg_color
#if GKT_WIDGET_BGCOLOR_VARIOUS
#define GKT_WIDGET_BG_COLOR(widget)	(widget)->bg_color
#else
#define GKT_WIDGET_BG_COLOR(widget)	GKT_WIDGET_BG_COLOR_DEFAULT
#endif
#endif

/* widget rect */
#define GKT_WIDGET_RECT(widget)	(widget)->desc->rect
#define GKT_WIDGET_RECT_PTR(widget)	&(widget)->desc->rect
#define GKT_WIDGET_X(widget)	GKT_WIDGET_RECT(widget).x
#define GKT_WIDGET_Y(widget)	GKT_WIDGET_RECT(widget).y
#define GKT_WIDGET_WIDTH(widget)	GKT_WIDGET_RECT(widget).width
#define GKT_WIDGET_HEIGHT(widget)	GKT_WIDGET_RECT(widget).height
#endif

#endif	/* GKT_WIDGET_DEFINES_H */

